<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <form name="f1">
      <p>
        姓名
        <input type="text" name="name" />
      </p>
    </form>
    <script>
      document.f1.name.oninput = function () {
        console.log(document.f1.name.value);
      };

      document.f1.name.onchange = function () {
        console.log(document.f1.name.value);
      };

      document.f1.name.oncopy = () => console.log("copy");
      document.f1.name.oncut = () => console.log("cut");
      document.f1.name.onpaste = () => console.log("paste");
    </script>
  </body>
</html>
